package com.dd.web.securities.proxy;

import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 证券指数服务类
 * http://www.csindex.com.cn/zh-CN/indices/index-detail/000001?earnings_performance=3%E4%B8%AA%E6%9C%88&data_typ
 */
@Headers("Content-Type: application/json")
@FeignClient(name = "indicesProxy",url = "http://www.csindex.com.cn/zh-CN/indices/index-detail")
public interface IndicesProxy {
    /**
     * 获取指数数据
     * @return
     */
    @GetMapping("/{indicesCode}?data_type=json")
    ResponseEntity<String> getIndices(@PathVariable("indicesCode") String indicesCode,
                                      @RequestParam("earnings_performance") String sj);
}
